<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>帖子列表</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <style>
    	.layui-bg-black{width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.hide {display: none;}
    	.checkbox{display: inline-block;}
    	.layui-form-item{font-size: 18px;}
    	.width100 {width: 100px; margin-right: 30px;float: left;}
    	.width180 {width: 180px; margin-right: 20px;float: left;}
    	.layui-input { display: inline-block; }
    	.last{ font-size: calc(20px + 18vh);line-height: calc(20px + 20vh);text-shadow: 0 0 5px #ffa500, 0 0 15px #ffa500, 0 0 20px #ffa500, 0 0 40px #ffa500, 0 0 60px #ff0000, 0 0 10px #ff8d00, 0 0 98px #ff0000;color: #fff6a9;}
    </style>
</head>
<body  class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 204px;top: 4px; width: calc(100% - 210px);" >
<fieldset class="layui-elem-field layui-field-title" >
  <legend>操作提示</legend>
</fieldset>

<div class="layui-form hide" id="discuss_temp" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-block">
	      <select name="discuss_type" id="discuss_type" class="width100 layui-select">
	 				<option value="3">打招呼</option>
	 				<option value="4">赞美</option>
	                <option value="5">可爱</option>
	                <option value="6">嫌弃</option>
	                <option value="7">求交往</option>
	                <option value="0">其他</option>
			    </select>
    </div>
  </div>
</div>

<div class="layui-form hide" id="repeat_temp" style="padding-top:20px;padding-right:20px;">
	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">发帖用户id</label>
	    <div class="layui-input-block">
	      <input name="repeat_user_id" id="repeat_user_id" class="layui-text layui-input"  placeholder="不填或0,不变"   value="0"/>
	    </div>
    </div>
    <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">发帖时间</label>
	    <div class="layui-input-block">
	      <input name="repeat_create_time" id="repeat_create_time" class="layui-text layui-input"  placeholder="时间不填,立即发送"/>
	    </div>
    </div> 
</div>

<div class="layui-form hide" id="copy_temp" style="padding-top:20px;padding-right:20px;">
	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">爱此时用户id</label>
	    <div class="layui-input-block">
	      <input name="copy_user_id" id="copy_user_id" class="layui-text layui-input"  placeholder="不填或0,不变"   value="0"/>
	    </div>
    </div>
</div>
<div class="layui-form hide" id="discuss" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">地区</label>
    <div class="layui-input-block">
      <select name="area_x" id="area_x" >
      	<option value="0">随机男</option>
      	<option value="1">随机女</option>
      	<#list area_list as one>
        <option value="${one.code}">${one.name}</option>
        </#list>
      </select>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">内容</label>
    <div class="layui-input-block">
      <input name="content" id="content" placeholder="请输入内容" class="layui-input" />
    </div>
  </div>
</div>

<div class="layui-form hide" id="discuss_y" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">id</label>
    <div class="layui-input-block">
 		<input name="user_id_y" id="user_id_y" class="layui-input" placeholder="请输入id"  style="color: #dd0000;"/>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">内容</label>
    <div class="layui-input-block">
      <input name="content_y" id="content_y" placeholder="请输入内容" class="layui-input" />
    </div>
  </div>
</div>

<div class="layui-form hide" id="discuss_" style="padding-top:20px;padding-right:20px;">
  <div class="layui-form-item">
    <label class="layui-form-label">地区</label>
    <div class="layui-input-block">
      <select name="area_x" id="area_x" >
      	<option value="0">随机男</option>
      	<option value="1">随机女</option>
      	<#list area_list as one>
        <option value="${one.code}">${one.name}</option>
        </#list>
      </select>
    </div>
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">内容</label>
    <div class="layui-input-block">
      <input name="content" id="content" placeholder="请输入内容" class="layui-input" />
    </div>
  </div>
</div>

<blockquote class="layui-elem-quote layui-quote-nm">
 	<form action="${base}/card_list/index" method="post" id="dataForm" >
        <input type="hidden" id="page" name="page" value="1"/>
        <div class="layui-input-inline" >
        	<label class="layui-form-label">是否推荐:</label><select name="alt_tj" id="alt_tj" class="width100 layui-select">
        	<option value=""></option>
	        <option value="2">推荐</option>
	        <option value="1">不推荐</option>
      		</select>
      		<label class="layui-form-label">是否推荐:</label><select name="is_show" id="is_show" class="width100 layui-select">
        	<option value=""></option>
	        <option value="1">展示</option>
	        <option value="2">不展示</option>
      		</select>
      		<label class="layui-form-label">审核状态:</label><select name="is_check" id="is_check" class="width100 layui-select">
        	<option value=""></option>
        	<option value="0">未审核</option>
	        <option value="1">审核</option>
	        <option value="2">不审核</option>
      		</select>
      		<label class="layui-form-label">是否置顶:</label><select name="is_top" id="is_top" class="width100 layui-select">
        	<option value=""></option>
	        <option value="2">置顶</option>
	        <option value="1">不置顶</option>
	        <option value="3">未老帖新发</option>
	        <option value="4">未爱此时</option>
      		</select>
 		</div>
 		<div class="layui-input-inline" style="margin-top: 10px;" >
 			<label class="layui-form-label">地区:</label><select name="area" id="area" class="width100 layui-select">
 				<option value=""></option>
		      	<#list area_list as one>
		        <option value="${one.code}">${one.name}</option>
		        </#list>
		      </select>
 			
 			<label class="layui-form-label">板块:</label><select name="social" id="social" class="width100 layui-select">
 				<option value=""></option>
		      	<#list social_list as one>
		        <option value="${one.id}">${one.title}</option>
		        </#list>
		      </select>
		     <label class="layui-form-label">性别:</label><select name="sex" id="sex" class="width100 layui-select">
 				<option value=""></option>
 				<option value="1">男</option>
                <option value="2">女</option>
                <option value="3">CD</option>
                <option value="4">FtM</option>
                <option value="5">MtF</option>
		      </select>
		      <label class="layui-form-label">用户类别:</label><select name="is_true" id="is_true" class="width100 layui-select">
 				<option value=""></option>
 				<option value='1'>A类</option>
				<option value='2'>B类</option>
				<option value='3'>C类</option>
				<option value='4'>D类</option>
                <option value='100'>灰名单</option>
		      </select>
		      
 		</div>
 		<div class="layui-input-inline" style="margin-top: 10px;">
 			<input placeholder="帖子id" name ="card_id" class="width180 layui-input" value="${card_id?default('')}" />
 			
 			<input placeholder="五十度id" name ="user_id" class="width180 layui-input" value="${user_id?default('')}" title="不带20开头的." />
 			
 			<input placeholder="手机号" name ="user_mobile" class="width180 layui-input" value="${user_mobile?default('')}" />
 			
 			<input placeholder="昵称" name ="nick_name" class="width180 layui-input" value="${nick_name?default('')}" />
 			
 			<input placeholder="内容" name ="content" class="width180 layui-input" value="${content?default('')}" />
 		</div>
 		
 		<div class="layui-input-inline" style="margin-top: 10px;">
 			<label class="layui-form-label">地区负责人</label><select name="person" id="person" class="width100 layui-select">
 				<option value=""></option>
 				<option value="1">袁杰</option>
                <option value="2">李扬</option>
                <option value="3">张炜</option>
                <option value="4">常少彪</option>
                <option value="100">强制清空</option>
		      </select>
		    <label class="layui-form-label">模式</label><select name="img" id="img" class="width100 layui-select">
 				<option value="">无所谓</option>
 				<option value="1">有图</option>
                <option value="2">无图</option>
                <option value="3">本周最热</option>
                <option value="4">热度最多排序</option>
                <option value="5">评论最多排序</option>
<!--                 <option value="6">未老帖新发</option> -->
<!--                 <option value="7">未移至爱此时</option> -->
		      </select>
		      <!-- 
		    <label class="layui-form-label">老帖新发:</label><select name="is_forward" id="is_forward" class="width100 layui-select">
        		<option value=""></option>
	        	<option value="0">没发过</option>
      		</select>
      		<label class="layui-form-label">爱此时:</label><select name="is_copy" id="is_copy" class="width100 layui-select">
        		<option value=""></option>
	        	<option value="1">没发过</option>
      		</select>
      		 -->
 		</div>
 		<div class="layui-form" style="display: inline-block;">
	 		<div class="layui-input-inline layui-form-item" >
			    <div class="layui-input-block">
			      <input type="checkbox" name="pre" <#if pre??>checked=""</#if> id="pre"  lay-skin="switch" lay-text="是|否">
			      <button class="layui-btn" lay-submit=""> <span class="fa fa-search"></span>查询</button>
			      <a class="layui-btn" id="zan_x"> <span class="fa fa-thumbs-o-up"></span>3~13个点赞</a>
			      <a class="layui-btn" id="hot_x"> <span class="fa fa-rocket"></span>500~10000热度</a>
			      <a class="layui-btn" id="hot_x_2"> <span class="fa fa-rocket"></span>100~1000热度</a>
			      <a class="layui-btn" id="views_x"> <span class="fa fa-eye-slash"></span>100~1000浏览</a>
			      <a class="layui-btn" id="discuss_x"> <span class="fa fa-comments-o"></span>一键回复(随机)</a>
			      <a class="layui-btn" id="discuss_xy"> <span class="fa fa-comments-o"></span>一键回复(指定人)</a>
			      <a class="layui-btn" id="zan_x_2"> <span class="fa fa-thumbs-o-up"></span>1个点赞</a>
			      
			      <a class="layui-btn" id="discuss_x_temp"> <span class="fa fa-comments-o"></span>一键回复(模板)</a>
			    </div>
	 		</div>
	 	</div>
 		
    </form>
 	
</blockquote> 

<table class="layui-table" >
	<thead>
       <tr>
           <th><input type="checkbox" id="all" />帖子</th>
<!--            <th>圈子</th> -->
           <th>用户</th>
           <th>昵称</th>
           <th>sex</th>
           <th>省份</th>
           <th>类别</th>
           <th width="160px">内容</th>
<!--            <th>类型</th> -->
           <th>推荐</th>
           <th>展示</th>
	 	   <th>审核</th>
           <th>置顶</th>
           <th>会员到期</th>
           <th>评论/浏览/热度</th>
           <th>发布时间</th>
           <th>操作</th>
        </tr>
     </thead>
     <tbody>
     <#list page.list as one>
     <tr id="tr${one.id}">
     	<td ><input type="checkbox" name="id" value="${one.id}" /><a href="${base}/card_list/detail?id=${one.id}" onclick="last(${one.id});" target="_blank">${one.id}</a></td>
     	<td title="用户手机:${one.user_mobile?default('')}"><a href="${base}/users_list/detail?user_id=${one.user_id}" target="_blank" >${one.user_id?default('')}</a></td>
     	<td><#if one.vip_end_time gt now  ><span style="color:#FFD700;font-size:18px;">♛</span></#if><#if one.is_gray lt 2><span style="color:#DEB887;font-size:18px;">屎</span></#if><script>document.write(decodeURIComponent("${one.nick_name}"));</script></td>
     	<td>${one.sex_name?default('')}</td>
     	<td>${one.area_name?default('')}</td>
     	<td>${one.is_true_name}</td>
     	<td title="${one.content}"  onclick="play_msg(this);"><#if one.content?length gt 10>${one.content?substring(0,10)}...<#else>${one.content}</#if></td>
     	<td><a onclick="alt(${one.id});" > <#if one.alt_tj == 1><span class="fa fa-times-circle"></span><#else><span class="fa fa-check-circle"></span></#if></a></td>
     	<td><a onclick="show(${one.id});"><#if one.is_show == 1><span class="fa fa-check-circle"></span><#else><span class="fa fa-times-circle"></span></#if></a></td>
		<td><a onclick="_check(${one.id});"><#if one.is_check == 1><span class="fa fa-check-circle"></span><#else><span class="fa fa-times-circle"></span></#if></a></td>
		<td><a title="不可操作"><#if one.is_top == 1><span class="fa fa-times-circle"></span><#else><span class="fa fa-check-circle"></span></#if></a><a onclick="_up(${one.id});"><span class="fa fa-arrow-up"></span></a></td>
		<!-- <a onclick="_up(${one.id});"><span class="fa fa-arrow-down"></span></a> -->
<!--      	<td><a onclick="_top(${one.id});"><#if one.is_top == 1><span class="fa fa-times-circle"></span><#else><span class="fa fa-check-circle"></span></#if></a></td> -->
     	<td><#if one.vip_end_time?? ><#if one.vip_end_time gt 0 >${one.vip_end_time_string?default('')}</#if></#if> </td>
     	<td>${one.discuss?default('0')}/${one.views?default('0')}/${one.heat?default('0')}</td>
     	<td>${one.create_time_string} </td>
     	<td><a onclick="del(${one.id});" ><span class="fa fa-trash"></span></a> <a onclick="zan(${one.id});" ><span class="fa fa-thumbs-o-up"></span></a> <a onclick="discuss(${one.id});" ><span class="fa fa-comments-o"></span></a>
     	<a onclick="follow(${one.id});" title="关注" ><span class="fa fa-eye"></span></a>
     	<#if one.is_true gt 1 ><#if one.del_time lt 1><a onclick="repeat(${one.id});" title="老帖新发" ><span class="fa fa-download"></span></a></#if></#if>
     	<#if base=="/50du"><#if one.is_forward == 0><a onclick="copy(${one.id});" title="复制爱此时" ><span class="fa fa-copy"></span></a></#if></#if>
     	</td>
     </tr>
     </#list>
     </tbody>
</table>
<div id="pageDiv"></div>
<form action="${base}/util/uploadFile" method="post" name="uploadForm" enctype="multipart/form-data" id="uploadForm" class="hide" >
    <input name="pic" type="file" id="pic" class="hide"/>
</form>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/layui/layui.all.js"></script>
<script type="text/javascript">
$("#alt_tj").val('${alt_tj?default('')}');
$("#is_show").val('${is_show?default('')}');
$("#is_check").val('${is_check?default('')}');
$("#is_top").val('${is_top?default('')}');

$("#social").val('${social?default('')}');
$("#area").val('${area?default('')}');
$("#sex").val('${sex?default('')}');
$("#is_true").val('${is_true?default('')}');
$("#img").val('${img?default('')}');
$("#person").val('${person?default('')}');
$("#is_forward").val('${is_forward?default('')}');
$("#is_copy").val('${is_copy?default('')}');

function last(id){
	$("tr").removeClass("last");
	$("#tr"+id).addClass("last");
}

function playAudio(text){
    const url = "http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&text=" + encodeURI(text);      
    const audio = new Audio(url);
    audio.src = url;
    audio.play();
    return audio;
}
function play_msg(obj) {	
	try {
		playAudio($(obj).text());
		/*
		var speech = new SpeechSynthesisUtterance();
	    speech.lang = "zh";
	    speech.text = $(obj).text();
	    speech.volume = 9;//播放音量
	    speech.rate = 1; //播放语速
	    speech.pitch = 10;//音调高低
	    window.speechSynthesis.speak(speech);
	    */
	}catch(e) {
	  console.log(e)
	}
}
	
layui.use('laypage',function () {
    var laypage = layui.laypage ;
    laypage.render({
        elem:"pageDiv",
        count:${page.totalPage*15},
        limit:15,
        curr:${page.pageNumber},
        layout:['count','prev','page','next','skip'],
        jump:function (obj,first) {
            var page = obj.curr;
            console.log("page:" + page)
            if(!first){
                $("#page").val(page);
                $("#dataForm").submit();
            }
        }
    });
});



function discuss(id){
	layui.use('form', function() {
	    var form = layui.form;
	    form.render('select');
	});
	layer.open({
	    type: 1 ,
	    title: '帖子' + id +'评论',   //标题
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#discuss"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var area = $("#area_x").val();
	    	var content = $("#content").val();
	    	if (content){
	    		$.post("${base}/card_list/giveDiscuss",
				   		{"id":id,"area":area,"content":content,type:0},function(data){ 
				   			layer.alert(data);
				   			$("#discuss").hide();
				   		}
				 );	
	    	}
	        layer.close(index);
	        
	        $("#discuss").hide();
	    },
		cancel: function(){
			$("#discuss").hide();        
	    }
	});
}

function zan(id){
	layer.prompt({title: '请输入点赞数量，并确认', formType: 2}, function(content, index){
		$.post("${base}/card_list/giveLike",
		   		{"id":id,"num":content},function(data){ 
		   			layer.alert(data);
		   		}
		    );
		layer.close(index);
    });	
}
function follow(id){
	layer.prompt({title: '请输入关注数量，并确认', formType: 2}, function(content, index){
		$.post("${base}/card_list/giveFollow",
		   		{"id":id,"num":content},function(data){ 
		   			layer.alert(data);
		   		}
		    );
		layer.close(index);
    });	
}






var _id = 0 ;
$('body').bind('keyup', function(event) {
	　　if (event.keyCode == "13") {
	　　　　//回车执行查询
	　　　　_del();
	　　}
});
	
function _del(){
	console.log("_del " + _id);
	if (_id > 0 ){
		$.post("${base}/card_list/del",
		   		{"id":_id},function(data){ 
		   			layer.alert(data);
		   			window.location.reload();
		   		}
		    );
	}
}
	
function del(id){
	_id = id;
	//询问框
	layer.confirm('确定要删除吗？', {
	  btn: ['确定'] //按钮
	}, function(){
		_del();
	});
}

function alt(id){
	$.post("${base}/card_list/alt",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	    );  
}

function show(id){
	$.post("${base}/card_list/show",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	    );  
}

function _check(id){
	$.post("${base}/card_list/check",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	    );  
}

function _top(id){
	$.post("${base}/card_list/top",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   			window.location.reload();
	   		}
	    );  
}

function _up(id){
	$.post("${base}/card_list/up",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   		}
	    );  
}

function _down(id){
	$.post("${base}/card_list/down",
	   		{"id":id},function(data){ 
	   			layer.alert(data);
	   		}
	    );  
}

function copy(id){
	layer.open({
	    type: 1 ,
	    title: 'copy爱此时', 
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#copy_temp"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var user_id = $("#copy_user_id").val();
	    	$.post("${base}/card_list/copy",
	    	   		{"card_id":id,"user_id":user_id},function(data){ 
	    	   			layer.alert(data);
	    	   			//window.location.reload();
	    	   		}
	    	    );
	        layer.close(index);
	        $("#copy_temp").hide();
	    },
		cancel: function(){
			$("#copy_temp").hide();        
	    }
	});
}

function repeat(id){
	layui.use('laydate', function(){
		  var laydate = layui.laydate;
		  //执行一个laydate实例
		  laydate.render({
		    elem: '#repeat_create_time'
		    ,type: 'datetime'
		  });
	});
	layer.open({
	    type: 1 ,
	    title: '老帖新发,时间不填立即发送', 
	    area: ['600px', '400px'],   //宽高
	    shade: 0.4,   //遮罩透明度
	    content: $("#repeat_temp"),
	    btn: ['确定'], //按钮组
	    scrollbar: false ,//屏蔽浏览器滚动条
	    yes: function(index){
	    	var create_time = $("#repeat_create_time").val();
	    	var user_id = $("#repeat_user_id").val();
	    	$.post("${base}/card_list/repeat",
	    	   		{"user_id":user_id,"card_id":id,"create_time":create_time},function(data){ 
	    	   			layer.alert(data);
	    	   		}
	    	    );  
	        layer.close(index);
	        $("#repeat_temp").hide();
	    },
		cancel: function(){
			$("#repeat_temp").hide();        
	    }
	});

}




$("#all").click(function (){
	if ($("#all").prop("checked")) {
		$("input[name='id']").prop("checked", true);
	} else {
		$("input[name='id']").prop("checked", false);
	}
});

$("#zan_x").click(function (){
	 try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数    
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			$.post("${base}/card_list/give_like_select",
			   		{"ids":ids},function(data){ 
			   			layer.msg(data);
			   		}
			    );
		}
     }catch(e) {
        console.log(e)
     }
});


$("#zan_x_2").click(function (){
	 try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数    
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			$.post("${base}/card_list/give_like_select2",
			   		{"ids":ids},function(data){ 
			   			layer.msg(data);
			   		}
			    );
		}
    }catch(e) {
       console.log(e)
    }
});


$("#views_x").click(function (){
	 try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数    
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			$.post("${base}/card_list/give_views_select",
			   		{"ids":ids},function(data){ 
			   			layer.msg(data);
			   		}
			    );
		}
    }catch(e) {
       console.log(e)
    }
});


$("#hot_x").click(function (){
	 try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数    
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			$.post("${base}/card_list/give_hot_select",
			   		{"ids":ids},function(data){ 
			   			layer.msg(data);
			   		}
			    );
		}
    }catch(e) {
       console.log(e)
    }
});

$("#hot_x_2").click(function (){
	 try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){//遍历每一个名字为interest的复选框，其中选中的执行函数    
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			$.post("${base}/card_list/give_hot_select_2",
			   		{"ids":ids},function(data){ 
			   			layer.msg(data);
			   		}
			    );
		}
   }catch(e) {
      console.log(e)
   }
});

$("#discuss_x").click(function (){
	try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){ 
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			layui.use('form', function() {
			    var form = layui.form;
			    form.render('select');
			});
			layer.open({
			    type: 1 ,
			    title: '一键回复', 
			    area: ['600px', '400px'],   //宽高
			    shade: 0.4,   //遮罩透明度
			    content: $("#discuss"),
			    btn: ['确定'], //按钮组
			    scrollbar: false ,//屏蔽浏览器滚动条
			    yes: function(index){
			    	var area = $("#area_x").val();
			    	var content = $("#content").val();
			    	if (content){
			    		$.post("${base}/card_list/giveDiscuss_select",
						   		{"ids":ids,"area":area,"content":content},function(data){ 
						   			layer.msg(data);
						   			$("#discuss").hide();
						   		}
						 );	
			    	}
			        layer.close(index);
			        $("#discuss").hide();
			    },
				cancel: function(){
					$("#discuss").hide();        
			    }
			});
		}
	} catch(e) {
	   console.log(e)
	}
});
$("#discuss_x_temp").click(function (){
	try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){ 
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			layui.use('form', function() {
			    var form = layui.form;
			    form.render('select');
			});
			layer.open({
			    type: 1 ,
			    title: '一键回复(模板)', 
			    area: ['600px', '400px'],   //宽高
			    shade: 0.4,   //遮罩透明度
			    content: $("#discuss_temp"),
			    btn: ['确定'], //按钮组
			    scrollbar: false ,//屏蔽浏览器滚动条
			    yes: function(index){
			    	var discuss_type = $("#discuss_type").val();
		    		$.post("${base}/card_list/giveDiscuss_select_temp",
					   		{"ids":ids,"discuss_type":discuss_type},function(data){ 
					   			layer.msg(data);
					   			$("#discuss_temp").hide();
					   		}
					 );	
			        layer.close(index);
			        $("#discuss_temp").hide();
			    },
				cancel: function(){
					$("#discuss_temp").hide();        
			    }
			});
		}
	} catch(e) {
	   console.log(e)
	}
});


$("#discuss_xy").click(function (){
	try {
		var ids = "";
		$('input[name="id"]:checked').each(function(){ 
			ids = ids + $(this).attr("value")+",";
	    });
		if(ids){
			layer.open({
			    type: 1 ,
			    title: '一键回复', 
			    area: ['600px', '400px'],   //宽高
			    shade: 0.4,   //遮罩透明度
			    content: $("#discuss_y"),
			    btn: ['确定'], //按钮组
			    scrollbar: false ,//屏蔽浏览器滚动条
			    yes: function(index){
			    	var user_id = $("#user_id_y").val();
			    	var content = $("#content_y").val();
			    	if (content){
			    		$.post("${base}/card_list/giveDiscuss_one",
						   		{"ids":ids,"user_id":user_id,"content":content},function(data){ 
						   			layer.msg(data);
						   			$("#discuss_y").hide();
						   		}
						 );	
			    	}
			        layer.close(index);
			        $("#discuss_y").hide();
			    },
				cancel: function(){
					$("#discuss_y").hide();        
			    }
			});
		}
	} catch(e) {
	   console.log(e)
	}
});

</script>
</html>